package com.zhong;

import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
import java.lang.management.ThreadMXBean;

/**
 * @author zhong
 * @version 1
 * @date 2022/04/09
 * @contact 1478168700@qq.com
 **/
public class Client {
    public static void main(String[] args) {
        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        System.out.println(runtimeMXBean.getVmName());

        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();

        long[] allThreadIds = threadMXBean.getAllThreadIds();

        OperatingSystemMXBean osb = ManagementFactory.getOperatingSystemMXBean();
        System.out.println(osb.getName()); //Windows 10
        System.out.println(osb.getArch()); //amd 64
        System.out.println(osb.getAvailableProcessors()); //4
        System.out.println(osb.getVersion()); //10.0
        System.out.println(osb.getSystemLoadAverage()); //-1.0


    }
}
